<template>
  <div class="home">
    <el-container>
      <el-header>
        <div>
          <span class="logo">LOGO</span>
        </div>
        <el-menu active-text-color="white" :default-active="activeIndex" class="el-menu-demo" mode="horizontal"
          @select="handleSelect" :router="true">
          <el-menu-item index="/home/index">首页</el-menu-item>
          <el-menu-item index="/home/interaction">家校互动</el-menu-item>
          <el-menu-item index="/home/notice">局校通知</el-menu-item>
          <el-menu-item index="/home/message">消息统计</el-menu-item>
          <el-menu-item index="/home/user">用户统计</el-menu-item>
          <el-menu-item index="/home/school">学校管理</el-menu-item>
        </el-menu>
      </el-header>
      <el-container>
        <el-main>
            <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
import HelloWorld from '@/components/HelloWorld.vue'
import { RouterLink } from 'vue-router';

export default {
  data() {
    return {
      activeIndex: '1',
      activeIndex2: '1'
    }
  },
  methods: {
    handleSelect(key, keyPath) {
      console.log(key, keyPath);
    }
  },
  name: 'HomeView',
  components: {
    HelloWorld,
    RouterLink
  }
}
</script>
<style lang="less" scoped>
.home {
  .el-container {
    height: 100vh;
  }

  .el-header {
    line-height: 80px;
    font-size: 20px;
    display: flex;
    justify-content: space-around;
    background-color: #1890ff;
    line-height: 55px;

    .logo {
      display: inline-block;
      width: 50px;
      height: 50px;
      color: #fff;
      font-size: 30px;
    }

    .el-menu-demo {
      background-color: #1890ff;
      height: 50px;
    }

    .el-menu--horizontal>.el-menu-item.is-active {
      color: white;
    }

    .el-menu--horizontal>.el-menu-item {
      color: white;
    }

    .el-menu--horizontal {
      width: 800px;
      display: flex;
      justify-content: space-between;
    }

    .el-menu--horizontal>.el-menu-item:not(.is-disabled):focus,
    .el-menu--horizontal>.el-menu-item:not(.is-disabled):hover,
    .el-menu--horizontal>.el-submenu .el-submenu__title:hover {
      background-color: #1890ff;
    }

    .el-menu.el-menu--horizontal {
      border-bottom: #1890ff;
    }
  }

  // 内容
  .el-main {
    background-color: #f1f1f2;
    color: #333;

    .content-box {
      background-color: #fff;
      border-radius: 10px;
      height: 100%;
    }
  }
}
</style>
